<?php
namespace Admin\Controller;
use Think\Controller;
class BaseController extends Controller{
	public function _initialize(){
		//从session中取出username
		$id=$_SESSION['id'];
		//echo $id;
		//exit;
		//if(!empty($id)){
		//	return true;
		//}else{
		//	$this->success('没登录',U('Admin/login'));
		//}
		 if(!session('?username')){
			$this->redirect('Admin/Login',array(),2,'2秒进入登录界面');
		}
	}
}